﻿<phone:PhoneApplicationPage 
    x:Class="Islamic_influence_in_Venetian_cuture.View.InfluenceContent"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
    xmlns:converters="clr-namespace:Utils.WP7.Bing;assembly=Utils.WP7.Bing"
    xmlns:directionControl="clr-namespace:Islamic_influence_in_Venetian_cuture.View.UserControls"
    xmlns:this="clr-namespace:Islamic_influence_in_Venetian_cuture.View"
    xmlns:util="clr-namespace:Islamic_influence_in_Venetian_cuture"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="728"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <phone:PhoneApplicationPage.Resources>
        <maps:ApplicationIdCredentialsProvider ApplicationId="Ascx6L2YZVUPzDntFsZvAoIuzSUxBUsLAG_7nmEwe7agSHtjxSHpALnszLEBXvCt" x:Key="MapCredentials" />
        <converters:LocationConverter x:Key="locationConverter" />
        <converters:ItineraryItemDisplayConverter x:Key="itineraryConverter" />
        <this:TravelModeConverter x:Key="TravelModeConverter" />
        <util:TextAlignmentConverter x:Key="TextAlignmentConverter" />
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot contiene la griglia radice in cui viene inserito tutto il resto del contenuto della pagina-->
    <Grid x:Name="LayoutRoot">
        <controls:Panorama x:Name="Page" Title="ToFill" FontSize="40">
            <controls:Panorama.Background>
                <ImageBrush x:Name="Background" Stretch="Fill" ImageSource=""/>
            </controls:Panorama.Background>

            <!--Elemento Panorama uno-->
            <controls:PanoramaItem Header="{Binding Images}">
                <ListBox x:Name="ImageList" ItemsSource="{Binding}" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid HorizontalAlignment="Stretch">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Image Source="{Binding Source}" Stretch="UniformToFill" HorizontalAlignment="Left" Grid.Row="0" />
                                <Border Background="#80202020" BorderThickness="0" Grid.Row="1">
                                    <TextBlock Height="Auto" FontSize="30" VerticalAlignment="Top" Text="{Binding Caption}" Foreground="White" TextWrapping="Wrap" TextAlignment="{Binding Culture, Converter={StaticResource TextAlignmentConverter}}" />
                                </Border>
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>

            <!--Elemento Panorama due-->
            <controls:PanoramaItem Header="{Binding Description}">
                <Grid>
                    <ScrollViewer>
                        <TextBox x:Name="Description" GotFocus="Description_GotFocus" TextAlignment="{Binding Culture, Converter={StaticResource TextAlignmentConverter}}" BorderBrush="Transparent" TextWrapping="Wrap" AcceptsReturn="True" Text="{Binding Description}" d:LayoutOverrides="Width, Height" Background="#80202020" Foreground="White"/>
                    </ScrollViewer>
                </Grid>
            </controls:PanoramaItem>

            <controls:PanoramaItem Header="{Binding MapTitle}" x:Name="MapController" >
                <Grid>
                    <maps:Map ZoomBarVisibility="Visible" ZoomLevel="13" Center=" 45.4371,012.3275" CredentialsProvider="{StaticResource MapCredentials}" AnimationLevel="Full" CopyrightVisibility="Collapsed">
                        <maps:MapPolyline Locations="{Binding RoutePoints, Converter={StaticResource locationConverter}}" Stroke="#FF0000FF" StrokeThickness="5" />
                        <maps:Pushpin Location="{Binding StartPoint, Converter={StaticResource locationConverter}}" Content="Start" />
                        <maps:Pushpin Location="{Binding EndPoint, Converter={StaticResource locationConverter}}" Content="End" />
                    </maps:Map>
                </Grid>
            </controls:PanoramaItem>

            <controls:PanoramaItem Header="{Binding GetDirections}" x:Name="DirectionsControl" >
                
                <directionControl:DirectionUserControl/>
            </controls:PanoramaItem>

        </controls:Panorama>
    </Grid>

    <!--Le applicazioni basate su Panorama non devono mostrare un ApplicationBar-->

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar x:Name="appBar" IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Resources/BarIcons/Find.png" Click="ApplicationBarIconButton_Click"  Text="Go to"/>
            <shell:ApplicationBarIconButton IconUri="/Resources/BarIcons/Walk.png" Text="Walk/Drive" Click="ApplicationBarIconButton_Click_1"/>
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="out" Click="ApplicationBarIconButton_Click_2"/>-->
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="Arabic_bar" Text="Arabic" Click="Arabic_bar_Click" />
                <shell:ApplicationBarMenuItem x:Name="English_bar" Text="English" Click="English_bar_Click" />
                <shell:ApplicationBarMenuItem x:Name="Farsi_bar" Text="Farsi" Click="Farsi_bar_Click" />
                <shell:ApplicationBarMenuItem x:Name="Italian_bar" Text="Italiano" Click="Italian_bar_Click" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
